home *** CD-ROM | disk | FTP | other *** search
- //begin_lib <!-- Begin External JavaScript -- DO NOT REMOVE THIS LINE -->
-
- var scSpeed =150; var scTimer = null; var scLimit = 0; var scCount = 0;
- var scMsg=""; var scCounter = 0; var scStrings = new Array(); var scCurr =0;
- var scElement = window.status; var scIndex = 0; var rtText="";
-
- function jsScroll(){
- this.Strings = new Array();
- this.Add = sc_Add;
- this.NoPad = sc_NoPad;
- this.SetElement = sc_SetElement;
- this.SetSpeed = sc_setSpeed;
- this.SetCounter = sc_setCounter;
- this.ScrollLeft = sc_Left;
- this.ScrollRight = sc_Right;
- this.ScrollType = sc_Type;
- this.CountLeft = sc_CountLeft;
- this.CountRight = sc_CountRight;
- this.CountType = sc_CountType;
- this.StopNow = sc_Stop;
- }
-
- function scSetMsg(nmsg){
- if(!scElement){
- window.status = nmsg;
- }else{
- scElement.value = nmsg;
- }
- }
-
- function scDoLeft(nmsg){
- if(scCount<nmsg.length){
- nmsg= nmsg.substring(0,nmsg.length/2);
- scCurr++;
- }else{
- scCurr=0;
- nmsg= " ";
- }
- scSetMsg(nmsg);
- }
-
- function get_Array(){
- var str = scStrings[scIndex];
- if(scCount==str.length){
- if(scIndex<scStrings.length-1){
- scIndex++;
- }else{
- scIndex=0;
- scLimit++;
- }
- scMsg = scStrings[scIndex];
- scCount=0;
- }
- }
-
- function sc_Add(text){
- var str = "";
- for (var i = 0; i < text.length; i++){
- str+=" ";
- }
- this.Strings.push(str+text);
- scStrings = this.Strings;
- scMsg = scStrings[0];
- scIndex=0;
- }
-
- function sc_NoPad(text){
- this.Strings.push(text);
- scStrings = this.Strings;
- scMsg = scStrings[0];
- scIndex=0;
- }
-
- function sc_SetElement(element){
- if(element){
- scElement = element;
- }
- }
-
- function sc_setSpeed(i){
- if(!i){
- scSpeed = 100;
- }else{
- scSpeed = i;
- }
- }
-
- function sc_setCounter(i){
- if(!i){
- scCounter = null;
- }else{
- scCounter = i;
- }
- }
-
- function sc_Left(){
- get_Array();
- scCount++;
- scDoLeft(scMsg);
- scMsg = scMsg.substring(1,scMsg.length)+scMsg.substring(0,1);
- scTimer = setTimeout("sc_Left()",scSpeed);
- }
-
- function sc_Right(){
- get_Array();
- rtText=scMsg.substring(scMsg.length-scCount,scMsg.length);
- scSetMsg(rtText);
- scCount++;
- scTimer = setTimeout("sc_Right()",scSpeed);
- }
-
- function sc_Type(){
- get_Array();
- scCount++;
- rtText=scMsg.substring(0,scCount);
- scSetMsg(rtText);
- scTimer = setTimeout("sc_Type()",scSpeed);
- }
-
- function sc_CountLeft(){
- if(scLimit<scCounter){
- get_Array();
- scCount++;
- scDoLeft(scMsg);
- scMsg = scMsg.substring(1,scMsg.length)+scMsg.substring(0,1);
- scTimer = setTimeout("sc_CountLeft()",scSpeed);
- }else{
- scLimit=0;
- clearTimeout(scTimer);
- }
- }
-
- function sc_CountRight(){
- if(scLimit<scCounter){
- get_Array();
- rtText=scMsg.substring(scMsg.length-scCount,scMsg.length);
- scSetMsg(rtText);
- scCount++;
- scTimer = setTimeout("sc_CountRight()",scSpeed);
- }else{
- scLimit=0;
- clearTimeout(scTimer);
- }
- }
-
- function sc_CountType(){
- if(scLimit<scCounter){
- get_Array();
- scCount++;
- rtText=scMsg.substring(0,scCount);
- scSetMsg(rtText);
- scTimer = setTimeout("sc_CountType()",scSpeed);
- }else{
- scSetMsg("");
- scLimit=0;
- clearTimeout(scTimer);
- }
- }
-
- function sc_Stop(){
- clearTimeout(scTimer);
- }
-
- //end_lib <!-- End External JavaScript -- DO NOT REMOVE THIS LINE -->
-